package com.lantosec.hmrp.modules.notify.entity;

import java.time.LocalDateTime;
import java.util.Date;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.notify.vo.NotifyInfoVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 通知 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-05-22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class NotifyInfo extends BaseEntity<NotifyInfoVO> {

    private static final long serialVersionUID = 1L;
    public NotifyInfo(NotifyInfoVO vo){
        this.notifyId = vo.getNotifyId();
        this.notifyTypeId = vo.getNotifyTypeId();
        this.title = vo.getTitle();
        this.description = vo.getDescription();
        this.smsTag = vo.getSmsTag();
        this.publicTag = vo.getPublicTag();
        this.scheduleTag = vo.getScheduleTag();
        this.sendTime = vo.getSendTime();
        this.senderId = vo.getSenderId();
        this.sender = vo.getSender();
    }

    @Override
    public NotifyInfoVO convertToVO(){
        return new NotifyInfoVO(this);
    }


    /**
     * 系统通知ID
     */
    @TableId(value = "notify_id", type = IdType.ASSIGN_UUID)
    private String notifyId;

    /**
     * 通知类型
     */
    private String notifyTypeId;

    /**
     * 标题
     */
    private String title;

    /**
     * 描述
     */
    private String description;

    /**
     * 发送短信标识
     */
    private Integer smsTag;

    /**
     * 公示信息标记
     */
    private Integer publicTag;

    /**
     * 定时发送计划
     */
    private Integer scheduleTag;

    /**
     * 发送时间
     */
    private Date sendTime;

    /**
     * 发送人ID
     */
    private String senderId;

    /**
     * 发送人
     */
    private String sender;


    public enum ColName {
        notify_id, notify_type_id, title, description, sms_tag, public_tag, schedule_tag, send_time, sender_id, sender,
    }
}
